package main

import "fmt"

func test_pipe() {
	//声明变量，创建管道，make开内存空间，长度3
	pipe := make(chan int, 3)
	pipe <- 1
	pipe <- 2
	pipe <- 3

	t1 := <-pipe

	pipe <- 4

	fmt.Println("t1 = ", t1)
	fmt.Println(len(pipe))

	t2 := <-pipe
	fmt.Println("t2 = ", t2)
	fmt.Println(len(pipe))
}
